#!/bin/ash

# 看门狗, 要配置cron 使用

time=$(date "+%Y-%m-%d %H:%M:%S")


bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

. "$bin"/config.sh

source "$bin"/config.sh


pid=$(findPID)

if [ -z "$pid" ]; then
    echo "重启进程"
    echo "${time} 重启进程" >> ${GATEWAY_LOG_DIR}/watchdog.log
     startGateway
else
  echo "进程存活"
   echo "${time} 进程存活" >> ${GATEWAY_LOG_DIR}/watchdog.log
fi
